/**
 * 
 */
package de.cbf.cam.dsa.model.entities.states.stateChanger;

import java.beans.PropertyChangeSupport;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

import de.cbf.cam.dsa.model.entities.BattleChar;
import de.cbf.cam.dsa.model.entities.OneNPC;
import de.cbf.cam.dsa.model.persistence.Header;

/**
 * @author Nebelritter
 *
 */
@Entity
@Inheritance(strategy=InheritanceType.JOINED)
public abstract class StateChangerBase extends Header {
	
	public static final int PERMANENT 	= -1;
	public static final int IMIDIATE	= 0;
	
	public static String PROPERTYNAME = "StateChangerBase:";	
	/**
	 * @uml.property  name="propertyChangeSupport"
	 */
	public PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
	
	/**
	 * @uml.property  name="baseRoundsTillEffective"
	 */
	private int baseRoundsTillEffective;
	/**
	 * @uml.property  name="leftRoundsTillEffective"
	 */
	private int leftRoundsTillEffective;
	/**
	 * @uml.property  name="repeating"
	 */
	private boolean repeating= false;
	
	protected StateChangerBase() {
		super();		
	}
	
	public abstract void changeState(OneNPC character);
	public abstract void changeStateBattle(BattleChar character);

	/* (non-Javadoc)
	 * @see de.cbf.cam.dsa.model.persistence.Header#getGuid()
	 */
	@Override
	@Id
	public String getGuid() {
		return guid;
	}

	/* (non-Javadoc)
	 * @see de.cbf.cam.dsa.model.persistence.Header#setGuid(java.lang.String)
	 */
	@Override
	public void setGuid(String guid) {
		this.guid = guid;
	}

	/**
	 * @return
	 * @uml.property  name="leftRoundsTillEffective"
	 */
	public int getLeftRoundsTillEffective() {
		return leftRoundsTillEffective;
	}

	/**
	 * @param roundsTillEffective
	 * @uml.property  name="leftRoundsTillEffective"
	 */
	public void setLeftRoundsTillEffective(int roundsTillEffective) {
		this.leftRoundsTillEffective = roundsTillEffective;
	}

	/**
	 * @return
	 * @uml.property  name="repeating"
	 */
	public boolean isRepeating() {
		return repeating;
	}

	/**
	 * @param repeating
	 * @uml.property  name="repeating"
	 */
	public void setRepeating(boolean repeating) {
		this.repeating = repeating;
	}

	/**
	 * @return
	 * @uml.property  name="baseRoundsTillEffective"
	 */
	public int getBaseRoundsTillEffective() {
		return baseRoundsTillEffective;
	}

	/**
	 * @param baseRoundsTillEffective
	 * @uml.property  name="baseRoundsTillEffective"
	 */
	public void setBaseRoundsTillEffective(int baseRoundsTillEffective) {
		this.baseRoundsTillEffective = baseRoundsTillEffective;
	}
	
	
}
